package com.partner.control;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.partner.domain.University;
import com.partner.domain.ZhuanYe;
import com.partner.service.UniversityAndZhuanyeService;

@Controller
public class UniversityAndZhuanyeAction {
	UniversityAndZhuanyeService universityAndZhuanyeService = new UniversityAndZhuanyeService();
	@RequestMapping("/selectUniversity")
	public @ResponseBody List<University> selectUniversity() {
		System.out.println("查询大学");
		List<University> universities = new ArrayList<University>();
		List<University> temp = universityAndZhuanyeService.selectUniversity();
		if(temp!=null){
			universities = temp;
		}
		return universities;
	}
	
	@RequestMapping("/selectZhuanye")
	public @ResponseBody List<ZhuanYe> selectZhuanye() {
		System.out.println("查询大学");
		List<ZhuanYe> zhuanyes = new ArrayList<ZhuanYe>();
		List<ZhuanYe> temp = universityAndZhuanyeService.selectZhuanye();
		if(temp!=null){
			zhuanyes = temp;
			return zhuanyes;
		}
		return zhuanyes;
	}
}
